From 72e3f2232463e19be9a5be941922a6384e68424b Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 15 Mar 2006 11:06:45 +0100 Subject: [PATCH] Unlike x86 and apparently ia64, PowerPC delivers timer interrupts as a different exception than device interrupts. For PowerPC Xen, we emulate this exception rather than delivering timer events as virtual IRQs. This patch introduces no functional changes for x86 and ia64, but is a required change for xen/arch/ppc. Signed-off-by: Hollis Blanchard --- xen/arch/ia64/xen/xentime.c | 4 ++++ xen/arch/x86/time.c | 5 +++++ xen/common/schedule.c | 6 +++--- xen/include/xen/time.h | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/xen/arch/ia64/xen/xentime.c b/xen/arch/ia64/xen/xentime.c index 45ffcebff1..f17e786cbf 100644 --- a/xen/arch/ia64/xen/xentime.c +++ b/xen/arch/ia64/xen/xentime.c @@ -258,4 +258,8 @@ int reprogram_timer(s_time_t timeout) return 1; } +void send_timer_event(struct vcpu *v) +{ + send_guest_virq(v, VIRQ_TIMER); +} diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 59fa0bfe04..286df06a6f 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -923,6 +923,11 @@ void __init early_time_init(void) setup_irq(0, &irq0); } +void send_timer_event(struct vcpu *v) +{ + send_guest_virq(v, VIRQ_TIMER); +} + /* * Local variables: * mode: C diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 78863e5825..9eaa29847f 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -574,7 +574,7 @@ static void __enter_scheduler(void) { update_dom_time(next); if ( next->sleep_tick != schedule_data[cpu].tick ) - send_guest_virq(next, VIRQ_TIMER); + send_timer_event(next); } TRACE_4D(TRC_SCHED_SWITCH, @@ -610,7 +610,7 @@ static void t_timer_fn(void *unused) if ( !is_idle_vcpu(v) ) { update_dom_time(v); - send_guest_virq(v, VIRQ_TIMER); + send_timer_event(v); } page_scrub_schedule_work(); @@ -624,7 +624,7 @@ static void dom_timer_fn(void *data) struct vcpu *v = data; update_dom_time(v); - send_guest_virq(v, VIRQ_TIMER); + send_timer_event(v); } /* SCHEDOP_poll timeout callback. */ diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h index eec7f4082b..3a31af0112 100644 --- a/xen/include/xen/time.h +++ b/xen/include/xen/time.h @@ -59,6 +59,8 @@ extern void update_dom_time(struct vcpu *v); extern void do_settime( unsigned long secs, unsigned long nsecs, u64 system_time_base); +extern void send_timer_event(struct vcpu *v); + #endif /* __XEN_TIME_H__ */ /* -- 2.30.2